function abcd(sql,params,callback) {
    const mysql = require('mysql');
const conn = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    port: '3306',
    password: 'root',
    database: 'zhezhe'
});

conn.connect();

conn.query(sql,params,callback);

conn.end();
};

// abcd('select * from student where id>?',8,(err,result) => {
//     if(err) return console.log(err);
//     console.log(result);
// })
// abcd('insert into student set ?',{name:'王丽丽',age:18},(err,result) => {
//     if(err || result.affectedRows <= 0) {
//         console.log(err);
//         console.log('添加失败')
//     }else{
//         console.log('添加成功')
//     }
// })

//导出
module.exports = abcd;
